<template>
    <el-table border :data="tableData" tooltip-effect="dark" max-height="400px">
        <template slot="empty">
            <no-data :types="false">
                <span>暂无数据</span>
            </no-data>
        </template>
        <el-table-column prop="experimentName" label="序号" type="index" width="60px"></el-table-column>
        <el-table-column width="150" v-for="(item, index) in fields" :key="index" :prop="item.prop" :label="item.label" show-overflow-tooltip></el-table-column>
    </el-table>
</template>
<script>
import {
    mapGetters
} from 'vuex'
import NoData from '@/components/NoData'
export default {
    name: 'FieldStatistics',
    components: { NoData },
    computed: {
        ...mapGetters({
            analysisReportData: 'common/getAnalysisReportData'
        })
    },
    data () {
        return {
            tableData: [],
            fields: [
                { prop: '名称', label: '字段名称' },
                { prop: '数据类型', label: '数据类型' },
                { prop: '总数', label: '总数' },
                { prop: '缺失值', label: '缺失值（占比）' },
                { prop: '0值', label: '0值（占比）' },
                { prop: '众数', label: '众数' },
                { prop: '最小值', label: '最小值' },
                { prop: '最大值', label: '最大值' },
                { prop: '均值', label: '均值' },
                { prop: '方差', label: '方差' },
                { prop: '标准差', label: '标准差' },
                { prop: '偏度', label: '偏度（skewness）' },
                { prop: '峰度', label: '峰度（kurtosis）' }
            ]
        }
    },
    created () {
        this.tableData = this.analysisReportData.content
    }
}
</script>
